#ifndef COMPLEX_H
#define COMPLEX_H

class Complex {
public:
    Complex(double re, double im);

    Complex &operator+=(const Complex &complex);
    Complex operator+(const Complex &complex) const;
    Complex &operator-=(const Complex &complex);
    Complex operator-(const Complex &complex) const;
    Complex &operator*=(const Complex &complex);
    Complex operator*(const Complex &complex) const;
    Complex &operator/=(const Complex &complex);
    Complex operator/(const Complex &complex) const;
    bool operator==(const Complex &complex);
    Complex &pow(int exponent);
    Complex &sq();
    Complex &sqrt();
    double real() const;
    double imag() const;
    double abs() const;
    double arg() const;
    void print() const;

private:
    double re;
    double im;
    friend class RenderArea;
};

Complex operator^(const Complex &complex, int exponent);

#endif // COMPLEX_H
